package com.leicx.guli.order;

import org.mybatis.spring.annotation.MapperScan;
import org.springframework.amqp.rabbit.annotation.EnableRabbit;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.session.data.redis.config.annotation.web.http.EnableRedisHttpSession;

/**
 * 使用rabbitMq
 * 1、引入amqp模块，RabbitAutoConfiguration就会自动生效
 * 2、给容器中自动配置了rabbitTemplate，amqpAdmin，rabbitMessagingTemplate，rabbitConnectionFactory
 * 3、yml配置
 * 4、注解开启，@EnableRabbit
 * 5、使用@RabbitListener，监听消息，必须有@EnableRabbit
 *    5.1 @RabbitListener 使用在类+方法上（监听哪些队列即可）
 *    5.2 @RabbitHandler  使用在方法上（重载区分不同的消息）
 *
 * @author daxiong
 * @date 2021/3/17 下午9:09
 */
@EnableRabbit
@EnableRedisHttpSession
@MapperScan("com.leicx.guli.order.dao")
@EnableDiscoveryClient
@EnableFeignClients
@SpringBootApplication
public class OrderMain {
    public static void main(String[] args) {
        SpringApplication.run(OrderMain.class, args);
    }
}
